<template>
	<!-- 我要帮助 -->
	<view>
		<view class="nav">
			<uni-nav-bar :border="false" left-icon="left" leftText="返回" title="我要帮助" />
		</view>
		
		<view class="text">社区管理员</view>
		
		<view class="ul">
			<view  v-for="item in list" :key="item.id" class="li">
				<view @click="chat(item)" class="left">
					<view class="ing">
						<image :src="baseImgUrl+item.photo" mode=""></image>
					</view>
					<view class="count">
						<view>{{item.name}}</view>
						<view>[{{item.typename}}]</view>
					</view>
				</view>
				<view @click="call(item.mobile)" class="rgt iconfont icon-dianhua1"></view>
			</view>
		 
		</view>
	</view>
</template>

<script>
	import {IMAGE_URL} from '../../utils/config.js'
	import {getStaff} from '../../api/staff.js'
	export default {
		data() {
			return {
				baseImgUrl:IMAGE_URL,
				list:[]
			}
		},
		onLoad() {
			
			this.getData();
		},
		methods: {
			chat(item){
				
				uni.navigateTo({
					url:`/pages/chat/chat?userid=${item.userid}&name=${item.name}&photo=${item.photo}`
				})
			},
			call(phoneNumber){
			  phoneNumber && uni.makePhoneCall({phoneNumber});
			},
			async getData(){
				
				const {errCode,data}=await getStaff();
				if(errCode===10000){
					this.list=data.list;
				}
				
			}
		}
	}
</script>

<style lang="scss" scoped>
	@import url("@/static/css/myhelp.css");
</style>
